<import file="block/common.html" name="url"/>
<div class="layui-fluid">
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-body ">
                <blockquote class="layui-elem-quote">
                    <b>提示：</b>每个按钮下的设置都需要单独点击保存！！
                </blockquote>
            </div>
        </div>
    </div>
    <button type="button" class="layui-btn" onclick="loadMain('<{caUrl('system','index')}>&name=siteinfo&menuname=网站设置')">网站设置</button>
    <button type="button" class="layui-btn layui-btn-primary" onclick="loadMain('<{caUrl('system','index')}>&name=cache&menuname=缓存设置')">缓存设置</button>
    <button type="button" class="layui-btn layui-btn-primary" onclick="loadMain('<{caUrl('system','index')}>&name=upload&menuname=上传设置')">上传设置</button>
</div>
<div class="layui-fluid">
 <div class="layui-form">
    <div class="layui-form-item">
        <label class="layui-form-label required">网站名称</label>
        <div class="layui-input-inline">
            <input type="text" name="sitename" lay-verify="required" lay-reqtext="网站名称不能为空" placeholder="请输入网站名称"  value="<{$config['sitename']}>" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">网站域名</label>
        <div class="layui-input-inline" style="width:280px;">
            <input type="text" name="siteurl" lay-verify="required" lay-reqtext="网站域名不能为空" placeholder="请输入网站域名"  value="<{$config['siteurl']}>" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">META关键词</label>
        <div class="layui-input-block">
            <textarea name="keywords" class="layui-textarea" placeholder="多个关键词用英文状态 , 号分割"><{$config['keywords']}></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">META描述</label>
        <div class="layui-input-block">
            <textarea name="descript" class="layui-textarea"><{$config['descript']}></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label required">版权信息</label>
        <div class="layui-input-block">
            <textarea name="copyright" class="layui-textarea"><{$config['copyright']}></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
		<?php echo sysrolTF("siteconfig_edit")?'<button class="layui-btn" lay-submit lay-filter="setting">'.lang('save').'</button>':''; ?> 
        </div>
    </div>
</div>
</div>

<script>
    layui.use(['form'], function () {
        var form = layui.form
            , layer = layui.layer,
			$ = layui.jquery;
        form.render();

        //监听提交
		form.on('submit(setting)', function (data) {
			$.post('<{caUrl("system","edit")}>&name=siteinfo',data.field,function(res){
                if(res.status == 1){
                    layer.msg(res.info, {icon: 1, time: 1000}, function(){
                        loadMain('<{caUrl("system","index")}>&name=siteinfo');
                    });
                }else{
                    layer.msg(res.info, {icon: 1, anim: 6, time: 5000});
                }
            });
		});
    });
</script>
